The present disclosure relates generally to computers, and more specifically, to a system and method for reducing a resolution of a graphical image for display on a computer.
There are many different types of display devices requiring different formats of data to display. For example, a 640.times.480 pixel display, with each pixel having one of 256 colors selected from a larger group of 262,144 possible colors, is commonly used in personal computers. However, other displays, or other display drivers such as ones that do not use a VESA standard video BIOS or cannot support 256 colors, instead may only utilize 16 colors. As a result, any 256 color images must be converted to 16 colors.
Previous methods to display images on a reduced color set, such as a 256 color "source" image to a 16 color "target" image, include dithering and color quantizing. Conventional dithering involves interspersing colors to fool the eye into seeing a third, or intermediate, color. While dithering usually supplies more color precision, it is at a cost of image detail. Such image detail can be critical. For example, in graphic images including a combination of text and background, if image detail is lost, the text blends-in to the background and becomes difficult to read.
Conventional color quantization is a process of reducing the source images number of colors by merging similar colors together, until the target number of colors is reached. It requires extensive processing, performing multiple passes through the source image to gather information about the frequency and variety of colors used to determine an optimal color set for the target image. Once created, the colors can be modeled as a three dimensional space, such as one defined by a red axis, a green axis and a blue axis (RGB color space). In the RGB color space, all colors exist, with black being at the origin (0,0,0) and white being the furthest point away from the origin. Once the color space is created, it is divided into sub-areas, in which each sub-area (containing many colors) maps to a single target color. In this way, many different colors of the source image are mapped to a single target color. As a result of such extensive processing, quantization error for the colors of the source image are minimized.
Although color precision is lost in color quantization, image details are preserved. In the example graphic image having a combination of text and background as discussed above, with color quantization, image detail is retained and the text does not blend-in to the background. However, since color precision is lost, the text can become difficult to read if the color of the text and the color of the background are reduced to similar colors.
What is desired, therefore, is a reduction process that is quick, i.e., does not require extensive processing. Furthermore, what is desired is a reduction process that produces a target image with accurate image details. Further still, what is desired is a reduction process that makes text easy to read against a background despite the reduction in colors.